﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;

using Volo.Abp.EntityFrameworkCore;

namespace ApproveFlowEngine.EntityFrameworkCoreSplitTable.EFCore.Core
{
    public class SplitDbContext : AbpDbContext<SplitDbContext>
    {
        public SplitDbContext(DbContextOptions<SplitDbContext> options) : base(options)
        {
        }

        public override void Initialize(AbpEfCoreDbContextInitializationContext initializationContext)
        {
            base.Initialize(initializationContext);
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(optionsBuilder);
            optionsBuilder.ReplaceService<IModelCacheKeyFactory, SplitModelCacheKeyFactory>();
            optionsBuilder.ReplaceService<IModelCustomizer, SplitModelCustomizer>();
        }
    }
}